<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改公告类别')"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-edit" th:object="${category}">
        <input id="id" name="id" type="hidden" th:field="*{id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label ">公告分类名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="name" id="name" th:field="*{name}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: ztree-js"/>
<script type="text/javascript">


    function edit() {
        var id = $("input[name='id']").val();
        var name = $("input[name='name']").val();
        var remark = $("input[name='remark']").val();
        $.ajax({
            cache: true,
            type: "POST",
            url: ctx + "notice/category/edit",
            data: {
                "id": id,
                "name": name,
                "remark": remark
            },
            async: false,
            error: function (request) {
                $.modal.alertError("系统错误");
            },
            success: function (data) {
                $.operate.successCallback(data);
            }
        });
    }

    // 点击确定按钮回调方法
    function submitHandler() {
        edit();
    }
</script>
</body>
</html>
